home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 40
/
Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso
/
Aminet
/
util
/
cdity
/
ModeProSrc.lha
/
Prefs
/
MPPNodes.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-04-12
|
1KB
|
58 lines
#include "MPP.h"
extern struct List ForcedEditList;
extern struct MPMessage *ForcedEditMsg;
extern struct MPSem *MPSem;
extern LONG LVActive, NodeCnt;
extern UWORD CurrentList;
struct DefaultNode *GetActiveNode(void)
{
struct Node *n;
ULONG active;
if(ForcedEditMsg)
{
n=(struct Node *)ForcedEditMsg->Data;
}
else
{
active=LVActive;
if(IsListEmpty(&MPSem->PromotionList[CurrentList]))
n=NULL;
else
{
n=MPSem->PromotionList[CurrentList].lh_Head;
while(active>0 && n->ln_Succ)
{
n=n->ln_Succ;
active--;
}
if(!n->ln_Succ)
{
LVActive=0;
n=MPSem->PromotionList[CurrentList].lh_Head;
}
}
}
return((struct DefaultNode *)n);
}
LONG CountNodes(struct List *List)
{
struct Node *n;
LONG nodecnt=0;
//NodeCnt=0;
//n=(struct DefaultNode *)(MPSem->PromotionList[CurrentList].lh_Head);
n=List->lh_Head;
while(n->ln_Succ)
{
n=n->ln_Succ;
nodecnt++;
}
return(nodecnt);
}